Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: expand opts to deps, so hook isn't recreated #108

Merged
merged 1 commit into from
Aug 13, 2024

Conversation

thebuilder
Copy link
Contributor

The useDebouncedCallback recreated the memorized function on each render, since it was using the entire options as a dependency, instead of the individual option values.

@thebuilder thebuilder merged commit aad6451 into main Aug 13, 2024
12 checks passed
@thebuilder thebuilder deleted the fix/expand-options-to-deps branch August 13, 2024 14:21
Copy link

size-limit report 📦

Path Size
use-debounced-callback 173 B (0%)
use-debounced-value 210 B (0%)
use-element-size 264 B (0%)
use-media 245 B (0%)
use-previous 239 B (0%)
use-script 275 B (0%)
use-window-size 85 B (0%)

Copy link

pkg-pr-new bot commented Aug 13, 2024

commit: b359950

pnpm add https://pkg.pr.new/charlie-tango/hooks/@charlietango/hooks@108

Open in Stackblitz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant